<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2018/12/12
 * Time: 22:44
 */

namespace app\modules\iterator;


class Book
{
    /**
     * @var string
     */
    private $_author;

    /**
     * @var string
     */
    private $_title;

    public function __construct(string $author, string $title)
    {
        $this->_author = $author;
        $this->_title = $title;
    }

    /**
     * @return string
     */
    public function getAuthor(): string
    {
        return $this->_author;
    }

    /**
     * @return string
     */
    public function getTitle(): string
    {
        return $this->_title;
    }

    public function getAuthorAndTitle(): string
    {
        return $this->getTitle() . ' by ' . $this->getAuthor();
    }
}